package com.ymttest.database.sqlwapper.CouponShop2cn;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.CouponShop2cn.couponsendsubtask;
import com.ymttest.utils.EnvSetup;

public class couponsendsubtaskWapper {
	SqlManager manager;

    public couponsendsubtaskWapper() {
        manager = new SqlManager("mysqlcouponshop2cn" + EnvSetup.getEnv());
    }

    public List<Map> selectTaskByTaskTypelimit(Integer TaskType,int limit)  {
    	Map map=new HashMap<String,Object>();
    	map.put("TaskType", TaskType);
    	map.put("limit", limit);
        List<Map> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.CouponShop2cn.couponconversionMapper.selectTaskByTaskTypelimit",
                        map);
        manager.commit();
        return result;
    }
    
    public List<couponsendsubtask> selectcouponsendsubtaskByTaskId(Integer taskId)  {
    	Map map=new HashMap<String,Object>();
    	map.put("taskId", taskId);
        List<couponsendsubtask> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.CouponShop2cn.couponconversionMapper.selectcouponsendsubtaskByTaskId",
                        map);
        manager.commit();
        return result;
    }
    
    public int setStatusByTaskId(int taskId)
    {
    	int result=manager.update(
                "com.ymttest.database.mapping.CouponShop2cn.couponconversionMapper.setStatusByTaskId",
                taskId);
         manager.commit();
         return result;
    }




    public static void main(String[] args) {
    	couponsendsubtaskWapper test = new couponsendsubtaskWapper();

      //  System.out.println(test.usecouponsendsubtask(20238699, "AIL7PT3W1",null));
        // test.insertYmtcouponsendsubtaskSetting(3,11);
        // Logger.debug(test.getLastYmtcouponsendsubtaskSettingId());


    }
}
